[Feedback]: 로직 피드백 및 주석 추가#62
Conversation
| import { BottomNavigationStyleConfig as BottomNavigation } from 'chakra-ui-bottom-navigation'; | ||
|
|
||
| // [May]: 여기 정의해두셔도 괜찮지만, 따로 파일 분리해도 좋을거같습니다..! | ||
| const queryClient = new QueryClient({ |
There was a problem hiding this comment.
Consider moving the definition of queryClient to a separate file. This will help in maintaining the code and improving readability.
| }); | ||
|
|
||
| // [May]: 여기 정의해두셔도 괜찮지만, 따로 파일 분리해도 좋을거같습니다..! | ||
| const chakraTheme = extendTheme({ |
There was a problem hiding this comment.
It would be better to separate the chakraTheme into a different file for better code organization and readability.
| mutationFn: createAnswer, | ||
| onSuccess: (data) => { | ||
| console.log('Answer created successfully:', data); | ||
| }, |
There was a problem hiding this comment.
Avoid using console.log in production code. If you need to log the success message, consider using a logging library that can be toggled for production or development environments.
| }, | ||
| // [Should] 단순히 로그를 찍는것보다 회원가입 / 로그인 페이지로 리다이렉트 시켜주는게 사용자 경험에 더 좋을거같습니다 | ||
| onError: (error) => { | ||
| console.error('Failed to create answer:', error); |
There was a problem hiding this comment.
Avoid using console.error in production code. Consider using a more user-friendly way to display errors, such as a toast notification or a message in the UI.
| // [Should] 단순히 로그를 찍는것보다 회원가입 / 로그인 페이지로 리다이렉트 시켜주는게 사용자 경험에 더 좋을거같습니다 | ||
| onError: (error) => { | ||
| console.error('Failed to create answer:', error); | ||
| navigate('/login'); |
There was a problem hiding this comment.
It might not be appropriate to always redirect to the login page when an error occurs. The error could be due to other reasons, not necessarily because the user is not logged in. Consider handling different types of errors differently.
| return; | ||
| } | ||
|
|
||
| // [Question] 백엔드랑 합의된 로그인 / 회원가입 유효성 검사가 존재하나요? |
There was a problem hiding this comment.
Avoid adding questions or suggestions as comments in the code. Instead, consider discussing these points with your team or through the PR comments section.
| // 현재 비밀번호 유효성 검사에 실패하여 회원가입이 실패되는데, 유저 입장에서는 무었때문에 거절 당한지 알수가없습니다 | ||
|
|
||
| // 모든 조건이 충족되면 로컬스토리지에 저장 | ||
| localStorage.setItem('registerEmail', data.email); |
There was a problem hiding this comment.
Storing sensitive information like passwords in local storage is not secure. Consider using more secure methods to handle passwords.
** #61 에서 파생된 브렌치입니다 **
이후 develop으로 변경 예정입니다.
🗒️ Describe your changes
2024.12.06: 01 - auth 로직 피드백
✅ PR CheckList
PR에 어떤 작업사항들이 반영됐는지 확인해주세요
📸 ScreenShots
스크린 샷을 첨부해 주세요 (선택)
🤔 To Reviewers